/* 
 * File:   Reader.h
 * Author: Guilherme Monteiro
 *
 */

#ifndef READER_H
#define	READER_H

#include <cv.h>
#include <highgui.h>
#include <cxcore.h>

#include <cerrno>
#include <string>

#include "MetaInfo.h"
#include "File.h"
#include "Cell.h"
#include "InvalidFileException.h"

using namespace std;

/**
 * Class that represents a reader.
 * It's used to obtains the points
 * of input files.
 * 
 * @author Guilherme Monteiro
 * 
 */
class Reader {
public:
    Reader(string inputFilePath) throw (InvalidFileException);
    Reader(const Reader& orig);
    virtual ~Reader();
    vector<Cell> readCells();
    vector<CvPoint> readPoints();
    vector< vector<Cell> > readTables();
private:
    string inputFilePath;
    vector<string> getData(string line);
    void setInputFilePath(string path) throw (InvalidFileException);
    vector<CvPoint> transformDataInPoints(vector<string> data);
};

#endif	/* READER_H */

